<template>
  <div class="bookmark">
    <div class="title">
      <div class="text">Моя коллекция</div>
    </div>
    <div class="selectList">
      <div class="selectTitle">Категория</div>
      <div class="selectUl">
        <el-select v-model="queryParams.categoryId" placeholder="Выбирай" @change="getlist" clearable>
          <el-option v-for="item in categoryList" :key="item.category_id" :label="item.translated_name" :value="item.category_id"/>
        </el-select>
        <el-select v-model="queryParams.likeTagId" placeholder="Выбирай" @change="getlist" clearable>
          <el-option v-for="item in likeTagList" :key="item.id" :label="item.translated_name" :value="item.id"/>
        </el-select>
        <el-select v-model="queryParams.likeTimeId" placeholder="Выбирай" @change="getlist" clearable>
          <el-option v-for="item in likeTimeList" :key="item.id" :label="item.translated_name" :value="item.id"/>
        </el-select>
      </div>
    </div>
    <div class="Product_listBox">
      <Product_list :col="4" :num="4" :list="list"></Product_list>
    </div>
  </div>
</template>
<script setup lang="ts">
import {reactive,ref} from "vue"
import Product_list from '@/components/Product_list/Product_list.vue'
import {postGoodslikeGetlist,getGoodslikeAjaxDropDown} from "@/api/api"
const queryParams=ref<any>({
  likeTagId:'',
  likeTimeId:'',
  categoryId:'',
  page:1,
  limit:100
})
const likeTagList = ref<any>([])
const likeTimeList = ref<any>([])
const categoryList = ref<any>([])
function getGoodslike(){
  getGoodslikeAjaxDropDown().then((res:any)=>{
    likeTagList.value = res.returnData.likeTagId
    likeTimeList.value = res.returnData.likeTime
    categoryList.value = res.returnData.categoryList
  })
}
getGoodslike()
const list = ref<any>([])
function getlist(){
  postGoodslikeGetlist(queryParams.value).then((res:any)=>{
    list.value = res.returnData.list
  })
}
getlist()
</script>
<style scoped lang="less">
.bookmark {
  width: 1164px;
  background: #FFFFFF;
  border-radius: 16px 16px 16px 16px;
  padding: 20px;
  box-sizing: border-box;

  .title {
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #EEEEEE;

    .text {
      font-family: Segoe UI, Segoe UI;
      font-weight: bold;
      font-size: 24px;
      color: #333333;
      line-height: 24px;
      text-align: left;
      font-style: normal;
      text-transform: none;
    }
  }

  .selectList {
    .selectTitle {
      margin-top: 20px;
      font-family: Segoe UI, Segoe UI;
      font-weight: 600;
      font-size: 16px;
      color: #333333;
      line-height: 16px;
      text-align: left;
      font-style: normal;
      text-transform: none;
    }

    .selectUl {
      margin-top: 16px;
      //display:flex;
      :deep(.el-select){
        width: 280px;
      }
      :deep(.el-select__wrapper) {
        width: 280px;
        height: 48px;
        border-radius: 12px 12px 12px 12px;
        border: 1px solid #CCCCCC;
      }
    }

    .selectUl > * {
      margin-right: 20px;
    }
  }

  .Product_listBox{
    margin-top: 40px;
  }
}
</style>
